package com.zmm.zebulon.module.system.biz.api.sms;

import com.zmm.zebulon.module.system.api.sms.SmsSendApi;
import com.zmm.zebulon.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
import com.zmm.zebulon.module.system.biz.service.sms.SmsSendService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

/**
 * description: 短信发送 API 实现类
 *
 * @author zebulon
 * package com.zmm.zebulon.module.system.biz.api.sms
 * name: SmsSendApiImpl
 * date 2024/1/7 22:10
 */
@Service
@Validated
public class SmsSendApiImpl implements SmsSendApi {

    @Resource
    private SmsSendService smsSendService;

    @Override
    public Long sendSingleSmsToAdmin(SmsSendSingleToUserReqDTO reqDTO) {
        return smsSendService.sendSingleSmsToAdmin(reqDTO.getMobile(), reqDTO.getUserId(),
                reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
    }

    @Override
    public Long sendSingleSmsToMember(SmsSendSingleToUserReqDTO reqDTO) {
        return smsSendService.sendSingleSmsToMember(reqDTO.getMobile(), reqDTO.getUserId(),
                reqDTO.getTemplateCode(), reqDTO.getTemplateParams());
    }

}
